package org.nfIt.controller;

import org.nfIt.entity.base.ProductUnit;
import org.nfIt.service.ProductUnitService;
import org.nfIt.vo.common.Result;
import org.nfIt.vo.common.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClossName:ProductUnitController
 * Pakage:org.nfIt.controller
 * Description
 *
 *商品单元数据
 *
 * @Author L
 * @Create 2024/8/23 22:16
 * @Version 2023.1.3
 */
@RestController
@RequestMapping("/admin/product/productUnit")
public class ProductUnitController {

    @Autowired
    private ProductUnitService productUnitService;

    /**
     * 查询商品单元数据
     */
    @GetMapping("findAll")
    public Result<List<ProductUnit>> findAll() {
        List<ProductUnit> productUnitList = productUnitService.findAll();
        return Result.build(productUnitList , ResultCodeEnum.SUCCESS) ;
    }
}
